<!DOCTYPE html>
<html>
<head>
    <title>块元素居中</title>
    <style>
        .header{
            width: 800px;
            margin: 50px auto;
            background-color: rgb(151, 151, 151);
            /* 内部元素居中 */
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="header">
        <img src="https://wx4.sinaimg.cn/orj360/0033ImPzly1gwmg5xcm4tg60rs0xc7wi02.gif"/>
    </div>
</body>
</html>